/**
 * Created by Administrator on 2017/3/8.
 */
$(function(){
    var date = new Date();
    $(".tk_time_start").text((date.getMonth()<9?('0'+(date.getMonth()+1)):(date.getMonth()+1))+'月'+date.getDate()+'日'+date.getHours()+'时'+date.getMinutes()+'分');

    $("#Task textarea").click(function(){
        $(this).parent().children("span").css("display","none");
    });
    $("#TaskReceive textarea").click(function(){
        $(this).parent().children("span").css("display","none");
    });
    /*时间控件*/
    var calendar = new LCalendar();
    calendar.init({
        'trigger': '.tk_time_right', //标签id
        'type': 'datetime2', //date 调出日期选择 datetime 调出日期时间选择 time 调出时间选择 ym 调出年月选择,
        'minDate': '1900-1-1', //最小日期
        'maxDate': '2100-1-1', //最大日期
        'target': '#end_time'
    });

    /*设置时间间隔*/
    $('.tk_naozhong').bind('click', function () {
        var iosSelect = new IosSelect(2,
            [
                [{'id':'1','value':'1'}, {'id':'2','value':'2'}, {'id':'3','value':'3'}, {'id':'4','value':'4'}, {'id':'5','value':'5'}, {'id':'6','value':'6'}, {'id':'7','value':'7'}, {'id':'8','value':'8'}, {'id':'9','value':'9'},{'id':'10','value':'10'},{'id':'11','value':'11'},{'id':'12','value':'12'},{'id':'13','value':'13'},{'id':'14','value':'14'},{'id':'15','value':'15'},{'id':'16','value':'16'},{'id':'17','value':'17'},{'id':'18','value':'18'},{'id':'19','value':'19'}, {'id':'20','value':'20'}, {'id':'21','value':'21'}, {'id':'22','value':'22'}, {'id':'23','value':'23'}, {'id':'24','value':'24'}, {'id':'25','value':'25'}, {'id':'26','value':'26'}, {'id':'27','value':'27'},{'id':'28','value':'28'},{'id':'29','value':'29'},{'id':'30','value':'30'},{'id':'31','value':'31'},{'id':'32','value':'32'},{'id':'33','value':'33'},{'id':'34','value':'34'},{'id':'35','value':'35'},{'id':'36','value':'36'},{'id':'37','value':'37'}, {'id':'38','value':'38'}, {'id':'39','value':'39'}, {'id':'40','value':'40'}, {'id':'41','value':'41'}, {'id':'42','value':'42'}, {'id':'43','value':'43'}, {'id':'44','value':'44'}, {'id':'45','value':'45'},{'id':'46','value':'46'},{'id':'47','value':'47'},{'id':'48','value':'48'},{'id':'49','value':'49'},{'id':'50','value':'50'},{'id':'51','value':'51'},{'id':'52','value':'52'},{'id':'53','value':'53'},{'id':'54','value':'54'},{'id':'55','value':'55'},{'id':'56','value':'56'},{'id':'57','value':'57'},{'id':'58','value':'58'},{'id':'59','value':'59'},{'id':'60','value':'60'}],
                [{'id':'hour','value':'小时'}, {'id':'minute','value':'分钟'}]
            ],
            {
                title: '设置时间',
                itemHeight: 35,
                callback: function (selectOneObj, selectTwoObj) {
                    $("input[name='tradeDate']").val(selectOneObj.value + selectTwoObj.value);
                    $("input[name='tradeDate']").data('num',selectOneObj.value);
                    $("input[name='tradeDate']").data('unit',selectOneObj.id);
                }
            });
    });
});